/**
 * Created by Sean Patrick Floyd (<a
 * href="mailto:sean@mostlymagic.com">sean@mostlymagic.com</a>) on 20.05.2010.
 */
package com.google.code.imds4j.impl.map;

import java.util.Collection;

import com.google.code.imds4j.api.DataStructure;
import com.google.code.imds4j.api.Query;

class SearchQuery<K, V> implements Query<V> {

    private final K key;
    private final DataStructure<K, V> dataStructure;

    public SearchQuery(final K key, final DataStructure<K, V> dataStructure) {
        this.key = key;
        this.dataStructure = dataStructure;
    }

    @Override
    public Collection<V> get() {
        return this.dataStructure.values(this.key);
    }

}